package com.cie2.janji.pages;

import java.util.List;

import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.chenillekit.tapestry.core.components.PagedLoop;

import com.cie2.janji.entities.Promise;
import com.cie2.janji.services.PromiseService;
import com.cie2.janji.services.PromiseStatusUIHelper;

public class PromisesPage {

	@Property
	private Promise promise;
	
//	@Component(parameters = {"source=promises", "value=promise"})
	@Component
	private PagedLoop pagedLoop;

	//services
	@Inject
	private PromiseService promiseService;
	
	//helper
	@Inject
	private PromiseStatusUIHelper promiseUIHelper;
	
	public List getPromises() {
		return promiseService.getAll();
	}
	
	public String getImage(Promise promise) {
		return promiseUIHelper.getImage(promise);
	}

	public String getAlt(Promise promise) {
		return promiseUIHelper.getAlt(promise);
	}
}
